﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using GPCSC.SQLServerDAL;

namespace GPCSC.Web.AJAX
{
    /// <summary>
    /// ComAjax 的摘要说明
    /// </summary>
    public class ComAjax : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        #region IHttpHandler 成员

        bool IHttpHandler.IsReusable
        {
            get { throw new NotImplementedException(); }
        }
        /// <summary>
        /// 保存活动
        /// </summary>
        /// <param name="context"></param>
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            string str = "";
            try
            {
                string tableName = context.Request["tableName"].ToString();
                string Pid = context.Request["Pid"].ToString();
                string Lname = context.Request["Lname"].ToString();
                string value = context.Request["value"].ToString();
                string pidvalue = context.Request["pidvalue"].ToString();
                Hashtable htable = new Hashtable();
                htable.Add(Lname, value);
                databyhtable dtable = new databyhtable();
                dtable.databyhtables(htable, "update", tableName, Pid, pidvalue);
                str = "SUCC";
                context.Response.ContentType = "text/plain";

                context.Response.Write(str);


            }
            catch (Exception ee)
            {
                str = "ERR";
                context.Response.ContentType = "text/plain";

                context.Response.Write(str);
            }

        }

        #endregion
    }
}